package com.ujiuye.Service.impl;

import com.ujiuye.Service.StudentService;
import com.ujiuye.demo.StudentDao;
import com.ujiuye.demo.impl.StudentDaoImpl;
import com.ujiuye.entity.Student;
import com.ujiuye.util.PackageUtil;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    StudentDao sd = new StudentDaoImpl();

    @Override
    public List<Student> getAllS() {
        return sd.getAllS();
    }

    @Override
    public int getCountRows() {
        return sd.getCountRows();
    }

    @Override
    public List<Student> getStudentByPage(PackageUtil p) {
        return sd.getStudentByPage(p);
    }

    @Override
    public boolean addStudent(Student stu) {
        return sd.addStudent(stu) == 0 ? false : true;
    }

    @Override
    public boolean delStudent(int sid) {
        return sd.delStudent(sid) == 0 ? false : true;
    }

    @Override
    public Student getStudentById(int sid) {
        return sd.getStudentById(sid);
    }

    @Override
    public boolean editStudent(Student stu) {
        return sd.editStudent(stu) == 0 ? false : true;
    }

    @Override
    public int getCountRowsBySname(String sname) {
        return sd.getCountRowsBySname(sname);
    }

    @Override
    public List<Student> getStudentBySname(PackageUtil pu, String sname) {
        return sd.getStudentBySname(pu,sname);
    }
}
